[id].vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation1></HomePageNavigation1>
  6. <!-- 列表页广告一 -->
  7. <HomeTopTen :imgurl="adList[0]" v-if="adList[0]"></HomeTopTen>
  8. <!-- 面包屑导航 -->
  9. <div class="breadcrumb">
  10. <div class="inner">
  11. <span class="location">当前位置:</span>
  12. <el-breadcrumb :separator-icon="ArrowRight">
  13. <el-breadcrumb-item>
  14. <NuxtLink to="/">首页</NuxtLink>
  15. </el-breadcrumb-item>
  16. <el-breadcrumb-item v-show="name">
  17. <NuxtLink :to="{ path: `/primaryNavigation/${listid}`}">{{name}}</NuxtLink>
  18. </el-breadcrumb-item>
  19. <el-breadcrumb-item>
  20. {{ newsDetail.con_title }}
  21. </el-breadcrumb-item>
  22. </el-breadcrumb>
  23. </div>
  24. </div>
  25. <!-- 资讯列表 -->
  26. <div class="newsDetail">
  27. <div class="inner">
  28. <div class="innerLeft">
  29. <div class="leftBottomTitle">{{ newsDetail.con_title }}</div>
  30. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  31. </div>
  32. <div class="innerRight">
  33. <div class="rightMenuTitle">导航列表</div>
  34. <ul>
  35. <li v-for="(item, index) in bottomMenu" :key="index">
  36. <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
  37. v-if="item.id == pageId && item.id != 7" class="active">
  38. {{ item.name }}
  39. </NuxtLink>
  40. <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
  41. v-else-if="item.id != pageId && item.id != 7">
  42. {{ item.name }}
  43. </NuxtLink>
  44. <NuxtLink :to="`/specialList/${item.id}`" :title="item.name"
  45. v-if="item.id == 7 && pageId == 7 && routeHref == '/specialList/7'" class="active">
  46. {{item.name }}
  47. </NuxtLink>
  48. <NuxtLink :to="`/specialList/${item.id}`" :title="item.name" v-else-if="item.id == 7">
  49. {{ item.name}}
  50. </NuxtLink>
  51. </li>
  52. </ul>
  53. </div>
  54. <div style="clear: both;"></div>
  55. </div>
  56. </div>
  57. <!-- 广告二 -->
  58. <HomeTopTen :imgurl="adList[1]" v-if="adList[1]"></HomeTopTen>
  59. <!-- 页面底部 -->
  60. <HomeFoot1></HomeFoot1>
  61. </template>
  62. <script setup>
  63. //1.页面依赖 start ---------------------------------------->
  64. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  65. import { ArrowRight } from '@element-plus/icons-vue'
  66. //获得跳转过来的id
  67. const route = useRoute();
  68. const articleId = route.params.id; //获得该页面的id
  69. const listid = route.query.listId; //获得该页面的id
  70. const name = route.query.listName; //获得该页面的id
  71. const pageId = route.params.id; //获得该页面的id
  72. const routeHref = route.href;
  73. //1.页面依赖 end ---------------------------------------->
  74. //2.页面数据 start ---------------------------------------->
  75. //广告列表
  76. let adList = ref([]);
  77. async function getAdData(){
  78. const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'PAGE'}});
  79. adList.value = adData.data;
  80. }
  81. getAdData();
  82. const newsDetail = ref({})
  83. const bottomMenu = ref([]);
  84. async function getPageData() {
  85. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
  86. method: 'GET',
  87. query: {
  88. 'fcat_id': articleId
  89. },
  90. });
  91. newsDetail.value = mkdata.data;
  92. }
  93. getPageData();
  94. async function getPageMenu() {
  95. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
  96. method: 'GET',
  97. query: {},
  98. });
  99. bottomMenu.value = mkdata.data;
  100. }
  101. getPageMenu();
  102. //2.页面数据 end ---------------------------------------->
  103. //4.设置seo信息 start---------------------------------------->
  104. //4.1 设置seo信息
  105. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  106. method: 'GET',
  107. query: {},
  108. });
  109. let seoTitle = setData.data.website_head.title;
  110. let seoDescription = setData.data.website_head.description;
  111. let seoKeywords = setData.data.website_head.keywords;
  112. let seoSuffix = setData.data.website_head.suffix;
  113. let seoName = setData.data.website_head.website_name;
  114. useSeoMeta({
  115. title: seoTitle + "_" + seoSuffix,
  116. meta: [
  117. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix },
  118. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix }
  119. ]
  120. });
  121. //4.设置seo信息 end---------------------------------------->
  122. </script>
  123. <style lang="less" scoped>
  124. //导航条
  125. .breadcrumb {
  126. width: 100%;
  127. height: 22px;
  128. margin-bottom: 30px;
  129. font-family: Microsoft YaHei, Microsoft YaHei;
  130. font-weight: 400;
  131. font-size: 20px;
  132. color: #666666;
  133. line-height: 23px;
  134. text-align: left;
  135. font-style: normal;
  136. text-transform: none;
  137. .el-breadcrumb::v-deep {
  138. display: inline-block;
  139. vertical-align: -4px;
  140. }
  141. /deep/.el-breadcrumb__inner a,
  142. /deep/.el-breadcrumb__inner.is-link {
  143. color: #666666;
  144. font-weight: 400;
  145. text-decoration: none;
  146. transition: var(--el-transition-color);
  147. }
  148. span {
  149. font-family: Microsoft YaHei, Microsoft YaHei;
  150. font-weight: 400;
  151. font-size: 20px;
  152. color: #666666;
  153. line-height: 23px;
  154. text-align: left;
  155. font-style: normal;
  156. text-transform: none;
  157. }
  158. span:hover {
  159. color: #666666;
  160. }
  161. .location {
  162. margin-right: 20px;
  163. width: 100px;
  164. height: 22px;
  165. font-family: Microsoft YaHei, Microsoft YaHei;
  166. font-weight: 400;
  167. font-size: 20px;
  168. color: #666666;
  169. line-height: 23px;
  170. text-align: left;
  171. font-style: normal;
  172. text-transform: none;
  173. }
  174. }
  175. // 资讯列表
  176. .newsDetail {
  177. width: 100%;
  178. //height: 1400px;
  179. margin-bottom: 70px;
  180. .inner {
  181. width: 1200px;
  182. //height: 1400px;
  183. font-size: 16px;
  184. .innerLeft {
  185. //height: 1400px;
  186. float: right;
  187. .LeftTop {
  188. //height: 522px;
  189. margin-top: 50px;
  190. >h1 {
  191. line-height: 40px;
  192. margin-bottom: 30px;
  193. font-family: Microsoft YaHei, Microsoft YaHei;
  194. font-weight: bold;
  195. font-size: 30px;
  196. color: #333333;
  197. }
  198. >p {
  199. height: 18px;
  200. line-height: 18px;
  201. font-family: Microsoft YaHei, Microsoft YaHei;
  202. font-weight: 400;
  203. font-size: 14px;
  204. color: #999999;
  205. span {
  206. margin-right: 40px;
  207. }
  208. }
  209. >img {
  210. width: 680px;
  211. height: 382px;
  212. padding: 50px 0px 60px 55px;
  213. }
  214. }
  215. .leftBottomTitle {
  216. color: #028E21;
  217. font-size: 24px;
  218. font-weight: bold;
  219. height: 60px;
  220. line-height: 60px;
  221. }
  222. .leftBottom {
  223. width: 790px;
  224. font-size: 20px;
  225. border-top: 1px solid #139602;
  226. padding-top: 40px;
  227. >h3,
  228. >p {
  229. text-indent: 2em;
  230. width: 790px;
  231. font-family: Microsoft YaHei, Microsoft YaHei;
  232. font-size: 20px;
  233. color: #333333;
  234. line-height: 23px;
  235. padding-bottom: 30px;
  236. }
  237. >h3 {
  238. font-weight: 600px;
  239. }
  240. >p {
  241. font-weight: 400;
  242. }
  243. }
  244. }
  245. .innerRight {
  246. width: 279px;
  247. .rightMenuTitle {
  248. width: 279px;
  249. height: 69px;
  250. font-size: 22px;
  251. font-weight: bold;
  252. line-height: 58px;
  253. text-align: center;
  254. color: #fff;
  255. background: url("http://img.bjzxtw.org.cn/master/bjzxtw/public/special/projectMoreTitle.png") no-repeat;
  256. margin-bottom: 30px;
  257. }
  258. ul {
  259. li {
  260. a {
  261. border-left: 5px solid #028E21;
  262. margin-bottom: 15px;
  263. font-size: 22px;
  264. display: block;
  265. height: 61px;
  266. line-height: 61px;
  267. color: #333333;
  268. text-align: center;
  269. background: #FBFBFB;
  270. }
  271. }
  272. }
  273. .active {
  274. border-left: 0;
  275. border: 1px solid #028E21;
  276. background: #fff;
  277. }
  278. }
  279. }
  280. }
  281. </style>